
#ifndef	COMMON_SLIST_H
#define	COMMON_SLIST_H


#include "common.h"

#include <cstdlib>


namespace	common
{
	class	slist
	{
	public:

		enum
		{
			max	= USHRT_MAX,
		};

		slist();
		~slist();

		bool			create( unsigned short max );
		void			destroy();

		bool			push( SLIST_ENTRY* entry );

		SLIST_ENTRY*	pop();
		SLIST_ENTRY*	pop_all();

		unsigned short	count()	const;

	private:

		SLIST_HEADER*	head_;
		unsigned short	max_;

	};
}



#endif